<?php
include("CrawlerAndroidmarker.php");
include("AndroidParseContent.php");
include("../config.php");
include("../InsertData.php");
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>采集androidmarker</title>
<meta name="keywords" content="采集androidmarker" />
<meta name="description" content="采集androidmarker" /> 
 
</head>
<body>
<?php
 ignore_user_abort(); // run script in background
     set_time_limit(0); // run script forever

   $craweruls = new CrawerURLAndroid();
   $partch = "<div class=\"thumbnail-wrapper goog-inline-block\"><a href=\"(.*?)\" class=\"thumbnail\"><img";
  // $url = "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=24&num=24";
   
   
   $urls = array(
//   				"https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=0&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=48&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=72&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=96&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=120&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=144&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=168&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=192&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=216&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=240&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=264&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=288&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=312&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=336&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=360&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=384&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=408&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=432&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=456&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=480&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=504&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=528&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=552&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=576&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=600&num=24",
//   				 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=624&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=648&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=672&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=696&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=720&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=744&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=768&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=CASUAL&start=792&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=0&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=24&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=48&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=72&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=96&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=120&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=144&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=168&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=192&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=216&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=240&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=264&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=288&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=312&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=336&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=360&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=384&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=408&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=432&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=SPORTS_GAMES&start=456&num=24",     
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=0&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=24&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=48&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=72&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=96&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=120&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=144&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=192&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=216&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=240&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=264&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=RACING&start=288&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=0&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=24&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=48&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=72&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=96&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=120&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=144&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=168&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=192&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=216&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=240&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=264&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=288&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=312&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=336&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=360&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=384&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=408&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=432&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=456&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=480&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=504&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=528&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=552&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=576&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=600&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=624&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=648&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=672&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=696&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=720&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=744&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=768&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=ARCADE&start=792&num=24", 
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=0&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=24&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=48&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=72&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=96&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=120&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=144&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=168&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=192&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=216&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=240&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=264&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=288&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=312&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=336&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=360&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=384&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=408&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=432&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=456&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=480&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=504&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=528&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=552&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=576&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=600&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=624&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=648&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=672&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=696&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=720&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=744&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=768&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=BRAIN&start=792&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=GAME_WIDGETS&start=0&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=GAME_WIDGETS&start=24&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=GAME_WIDGETS&start=48&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=GAME_WIDGETS&start=72&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=GAME_WIDGETS&start=96&num=24",
//                 "https://market.android.com/details?id=apps_topselling_free&cat=GAME_WIDGETS&start=120&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=0&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=24&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=48&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=72&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=96&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=120&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=144&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=168&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=192&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=216&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=240&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=264&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=288&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=312&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=336&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=360&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=384&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=408&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=432&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=456&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=480&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=504&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=528&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=552&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=576&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=600&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=624&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=648&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=672&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=696&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=720&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=744&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=768&num=24",
                 "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=792&num=24"
             );
                
    foreach($urls as $url){
//	                 $url =  "https://market.android.com/details?id=apps_topselling_free&cat=CARDS&start=672&num=24";
		   $ad = $craweruls->parseURLS($url,$partch); 
		 
	 
		   //分析内容
		   $parseContent = new AndroidParseContent();
		   //匹配每个游戏属性的正则表达式数字
			$regs = array("name" =>"<h1 class=\"doc-banner-title\">(.*?)<\/h1>",  
		             "date" =>"<dt>更新日期：<\/dt><dd>(.*?)<\/dd>",
		             "size" =>"<dt>大小：<\/dt><dd>(.*?)<\/dd>",
		             "introduce" =>"<div id=\"doc-original-text\">(.*?)<\/div>",
		             "imags" =>"<div class=\"doc-banner-icon\"><img src=\"(.*?)\" \/><\/div>"
		            );
		   
		   $parseContent->parseContent($ad,$regs); 
		   echo "采集第个24"."<br>";
    }
    echo "采集程序结束";
   
?>
</body>
</html>
